// @ts-nocheck
// 将字符串字面量类型按照指定字符，分割为元组。无法分割则返回元字符串字面量
type SplitString<T extends string, S extends string,A extends any[] = []> = T extends `${infer L}${S}${infer R}`? SplitString<R, S, [...A,L]> : [...A,T];

type A1 = SplitString<"handle-open-flag","-">; // ["handle","open", "flag"]
type A2 = SplitString<"open-flag","-">;
type A3 = SplitString<"handle.open.flag",".">;
type A4 = SplitString<"open.flag",".">;
type A5 = SplitString<"open.flag","-">;

export {};